<template>
	<view class="content">
		<u-parse :content="content"></u-parse>
	</view>
</template>

<script>
	import { getBaseSet } from '@/api/common.js'
	export default {
		data() {
			return {
				content: '',
				from: '',
				titleMap: {
					privacy: {
						name: '用户协议',
						type: 1
					},
					service: {
						name: '隐私政策',
						type: 2
					}
				}
			}
		},
		onLoad(option) {
			this.from = option.from
			uni.setNavigationBarTitle({
				title: this.titleMap[option.from].name
			})
			this.getBaseSet()
		},
		methods: {
			getBaseSet(){
				getBaseSet(this.titleMap[this.from].type).then(res => {
					this.content = res.data.bsContent
				})
			}
		}
	}
</script>

<style lang="scss">
	.content {
		padding: 20rpx 30rpx;
	}
</style>